'use strict';

const fs = require('fs')
const path = require('path')

exports.main = async (event, context) => {
	switch (event.action) {
		case "beauty":
			let file2 = path.join(__dirname, 'beautys.json');
			let result2 = JSON.parse(fs.readFileSync(file2, 'utf-8'));
			return result2;
			break;
		case "chbqb":
			let file1 = path.join(__dirname, 'chbqb.json');
			let result1 = JSON.parse(fs.readFileSync(file1, 'utf-8'));
			return result1;
			break;
		case "wanAndroid":
			let file3 = path.join(__dirname, 'adMenu.json');
			let result3 = JSON.parse(fs.readFileSync(file3, 'utf-8'));
			return result3;
			break
		case "mChart":
			let file4_name = event.name;
			let file4 = path.join(__dirname, `chart/${file4_name}`);
			let result4 = JSON.parse(fs.readFileSync(file4, 'utf-8'));
			return result4;
			break
		case "waveSvg":
			let file7 = path.join(__dirname, 'waveSvg.txt');
			let result7 = fs.readFileSync(file7, 'utf-8');
			return result7;
			break
		default:
			let file6_name = `${event.action}.json`
			let file6 = path.join(__dirname, file6_name);
			let result6 = JSON.parse(fs.readFileSync(file6, 'utf-8'));
			return result6;
			break
	}
};
